<template>
	<view class="content">
		<view class="section-1">
			<view class="list">
				<view class="item" v-for="(item, idx) in list" :key="item.project_name + item.user_name + idx">
					<view class="name">{{item.user_name}}</view>
					<view class="text">{{item.project_name}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { performListApi } from '@/api/statistics.js';
	export default {
		data() {
			return {
				list:[],
				type: 'week'
			};
		},
		methods:{
			// go(item) {
			// 	uni.navigateTo({
			// 		url: item.path
			// 	})
			// },
			async fetchData() {
				uni.showLoading({title: '加载中...'});
				const { data } = await performListApi(
					{
						type: 2,
						time_type: this.type === 'month' ? 2 : 1,
					}
				);
				uni.hideLoading();
				if (data.code === 1) {
					this.list = data.data;
				} 
			}
		},
		onReady() {
			this.fetchData();
		},
		onLoad(data) {
			this.type = data.type
			if (this.type === 'month') {
				uni.setNavigationBarTitle({
					title: '本月未履职人员'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		background-color: #2d5dfd;
	}
	.section-1{
		position: relative;
		z-index: 10;
		background-color: #fff;
		border-top-left-radius: 50rpx;
		border-top-right-radius: 50rpx;
		background-color: #fff;
		.list{
			width: 670rpx;
			box-sizing: border-box;
			margin-left: 40rpx;
			.item{
				box-sizing: border-box;
				width: 100%;
				border-bottom: solid 2rpx #f2f2f0;
				letter-spacing: 2rpx;
				color: #3b3c40;
				padding:20rpx 40rpx;
				text-overflow: ellipsis;
				overflow: hidden;
				white-space: nowrap;
				.name{
					font-size: 26rpx;
					color: #3b3c40;
					line-height: 50rpx;
				}
				.text{
					font-size: 16rpx;
					color: #7899b0;
				}
			}
		}
		.actions{
			width: 100%;
			height: 50rpx;
			margin-top: 29rpx;
			padding-bottom: 40rpx;
			display: flex;
			justify-content: space-between;
			.action{
				width: 288rpx;
				height: 48rpx;
				background-color: #395cf5;
				border-radius: 20rpx;
				text-align: center;
				line-height: 48rpx;
				font-size: 26rpx;
				font-weight: normal;
				font-stretch: normal;
				color: #ffffff;
				text{
					&:first-child{
						margin-right: 20rpx;
					}
				}
			}
			.search{
				background-color: #1534ce;
			}
		}
		.form{
			width: 100%;
			padding: 0 75rpx;
			padding-top: 40rpx;
			box-sizing: border-box;
			.form-item{
				width: 600rpx;
				height: 48rpx;
				border-radius: 20rpx;
				border: solid 2rpx #1534ce;
				margin: 0 auto;
				margin-bottom: 34rpx;
				@include clear();
				.label{
					float: left;
					width: 134rpx;
					height: 48rpx;
					text-align: center;
					line-height: 44rpx;
					font-size: 26rpx;
					font-weight: normal;
					font-stretch: normal;
					letter-spacing: 0rpx;
					color: #1534ce;
				}
				.shape{
					width: 3rpx;
					height: 32rpx;
					background-color: #7f98ae;
					float: left;
					margin-top: 8rpx;
				}
				.input{
					float: left;
					width: calc(100% - 134rpx - 3rpx);
					.input-body{
						box-sizing: border-box;
						width: 100%;
						height: 44rpx;
						padding: 0!important;
						border: none;
						padding-left: 30rpx!important;
						padding-right: 30rpx!important;
						font-size: 26rpx;
						font-weight: normal;
						font-stretch: normal;
						letter-spacing: 0rpx;
						color: rgba(0,0,0,0.7);
					}
					.input-placeholder{
						font-size: 26rpx;
						font-weight: normal;
						font-stretch: normal;
						letter-spacing: 0rpx;
						color: rgba(0,0,0,0.5);
					}
				}	
			}
		}
	}
</style>

